 package cn.com.epicc.wap.epe.swagger;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

 /**
  * Description: Swagger文档工具类
  * Author: lishangmin
  * Created: 2018-05-21 15:53
  */
 @Configuration
 @EnableSwagger2
public class SwaggerUtil {

    private static ApiInfo apiInfo(){
        return new ApiInfoBuilder()
                .title("人保非车险产品配置中心API文档")
                .contact(new Contact("中国人保","www.epicc.com.cn","shangmlee@foxmail.com"))
                .build();
    }

    @Bean
    public static Docket initDocket(){
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("cn.com.epicc.wap.epe"))
                .paths(PathSelectors.any())
                .build();
    }

}
